<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <form class="layui-form" action="<?=url('worker/add');?>">
            <div class="layui-form-item">
              <label class="layui-form-label">所属公司</label>
              <div class="layui-input-block">
                <?php foreach($info as $k=>$v): ?>
                    <input type="checkbox" value="<?=$v['id']?>" name="company_ids[]" title="<?=$v['title']?>">
                <?php endforeach; ?>
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">姓名</label>
              <div class="layui-input-block">
                <input type="text" name="name" required lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">电话</label>
              <div class="layui-input-block">
                <input type="text" name="phone"  autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">年龄</label>
              <div class="layui-input-block">
                <input type="text" name="age"  autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">性别</label>
              <div class="layui-input-block">
                    <select name="sex">
                        <option value="">请选择性别</option>
                      <?php foreach(c('type.sex') as $key => $v):?>
                          <option value="<?=$key?>" > <?=$v?> </option>
                      <?php endforeach;?>
                    </select>
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">家庭住址</label>
              <div class="layui-input-block">
                <input type="text" name="address"  autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">服务范围</label>
              <div class="layui-input-block">
                <input type="text" name="area"  autocomplete="off" class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">备注</label>
              <div class="layui-input-block">
                <textarea placeholder="请输入备注" name="note" class="layui-textarea"></textarea>
              </div>
            </div>

            <div class="layui-form-item">
              <label class="layui-form-label">评分</label>
              <div class="layui-input-block">
                <div id="test1"></div>
                <input type="hidden" id="score" name="score" value="">
              </div>
            </div>

          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="myform">立即提交</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
<script>
layui.use(['form','rate'], function(){
  var $ = layui.$
  ,form = layui.form
  ,rate = layui.rate;
  form.render();
  var ue = UE.getEditor('container');
  //基础效果
  rate.render({
    elem: '#test1'
    ,value: 0 //初始值
    ,half: true //开启半星
    ,setText: function(value){
      $("#score").val(value);
    }
  })
});
</script>
